package com.vone.export;

import java.util.List;
import java.util.Map;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.Font;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.util.CellRangeAddress;

import com.vone.entity.Basicdata;
import com.vone.entity.CsShareholder;
import com.vone.export.until.ExcelStyle;
import com.vone.export.until.ExcleSheet;

//创建股东信息，第二个sheet
public class BossBaseSheet {
	
	private Cell cell;
	private ExcleSheet exclesheet=null;
	private ExcelStyle excelstyle=null;
	
	
	//创建第二个sheeet
		@SuppressWarnings({ "unused", "unused" })
		public void getBossBaseSheet(Basicdata basicdatas){
			
			exclesheet=new ExcleSheet();//实例化表格
			excelstyle=new ExcelStyle();//实例化样式
			exclesheet.getsheetbossstyle();//调用实例化的方法	
			
			//设置表头
			Row rowheader = exclesheet.getSheetboss().createRow(1);
			rowheader.setHeight((short) 1000);
			String[] str={"*股东名称/姓名","*股东类型","*应缴金额(万元￥)","*实缴金额（万元￥）","*出资形式","*股份比例 %"};
			for(int i=0;i<str.length;i++){
				cell= rowheader.createCell(i);
				cell.setCellValue(""+str[i]+"");//设置第一行的字体
				cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式
			}
			//设置主题数据
			List<CsShareholder> csshareholder =basicdatas.getCsshareholder();
			if(csshareholder.size()>0&&csshareholder!=null){
				for (int i = 0; i < csshareholder.size(); i++) {
					Row rowdata = exclesheet.getSheetboss().createRow(i+2);
					rowdata.setHeight((short) 800);
					CsShareholder m2 = csshareholder.get(i);
					cell= rowdata.createCell(0);
					cell.setCellValue("" + m2.getShareholder_name());//创建第二个sheet，标题				
					cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式					
					cell= rowdata.createCell(1);
					cell.setCellValue("" + m2.getShareholder_type());
					cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式	
					cell= rowdata.createCell(2);
					cell.setCellValue("" + m2.getPayable_money());
					cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式					
					cell= rowdata.createCell(3);
					cell.setCellValue("" + m2.getActual_money());
					cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式
					cell= rowdata.createCell(4);
					cell.setCellValue("" + m2.getInvestment_form());
					cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式
					cell= rowdata.createCell(5);
					cell.setCellValue("" + m2.getRate());
					cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式
				}
			}else{
				Row rowdata = exclesheet.getSheetboss().createRow(2);
				rowdata.setHeight((short) 800);
				cell= rowdata.createCell(0);
				cell.setCellValue("无");//创建第二个sheet，标题				
				cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式					
				cell= rowdata.createCell(1);
				cell.setCellValue("无");
				cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式	
				cell= rowdata.createCell(2);
				cell.setCellValue("无");
				cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式					
				cell= rowdata.createCell(3);
				cell.setCellValue("无");
				cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式
				cell= rowdata.createCell(4);
				cell.setCellValue("无");
				cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式
				cell= rowdata.createCell(5);
				cell.setCellValue("无");
				cell.setCellStyle(excelstyle.getCellStyleheader());//设置样式		
			}
		}
}
